package com.forevershine.action;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.cohesion.bootstrap.common.PublicConstants;
import com.forevershine.action.model.Model;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
/**
 * The top menu action, will generated the menu according to the proper, priviledge.
 * @author Thomas Li
 *
 */
public class TopMenuAction extends ActionSupport {
	
	private static Log log = LogFactory.getLog(TopMenuAction.class);
	
	private Model model;
	
	
	


	public Model getModel() {
		return model;
	}


	public void setModel(Model model) {
		this.model = model;
	}


	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	
	public String execute()
	{
		System.out.println("top menu");
		//authenticate users
		model = new Model();
		//get session user & rights	
		//load up the menus
		loadDefaultMenu();
		// write menu back the page, only through request body, don't put anything in session.
		model.setUsername((String)ActionContext.getContext().getSession().get(PublicConstants.USER_ID));
		return SUCCESS;
	}


	private void loadDefaultMenu() {
		
		
	}

}
